package com.vivachek.protocol.enums

import com.vivachek.protocol.exception.NotSupportProtocolException

/**
 * @Author: YCB
 * @Time: 2022/9/29 15:20
 * @Email: congbin.yuan@vivachek.com
 * @Description: 结果类型枚举
 *
 */
enum class SampleEnums(val type:Int,val desc:String) {
    GLUCOSE_BLOOD(17,"血糖"),
    GLUCOSE_CTRL(34,"血糖质控液"),

    KETONES(85,"血酮"),
    KETONES_CTRL(102,"血酮质控液"),

    UA(119, desc = "尿酸"),
    UA_CTRL(136, desc = "尿酸质控液"),

    ;

    companion object{
        fun convert(type:Int): SampleEnums {
            values().forEach {
                if (it.type==type){
                    return it
                }
            }
            throw NotSupportProtocolException("无法解析样本类型")
        }
    }
}